index.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
c 3
b 0
f 0
nc 2
nop 2
dl 0
loc 5
rs 9.4285
1
'use strict'
2
3
import moment from 'moment'
4
export { genToken } from './tokenizer'
0 ignored issues
show
Bug introduced by
The variable genToken seems to be never declared. If this is a global, consider adding a /** global: genToken */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
5
export { isFunction, isObject } from 'lodash'
0 ignored issues
show
Bug introduced by
The variable isObject seems to be never declared. If this is a global, consider adding a /** global: isObject */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable isFunction seems to be never declared. If this is a global, consider adding a /** global: isFunction */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
6
7
export const addDays = (offset, date) => {
8
  date = date || new Date()
9
  const momentAt = moment(date).add(offset, 'days')
10
  return momentAt.toDate()
11
}
12
13
export const isAfter = (first, second) => {
14
  const firstMoment = moment(first)
15
  const secondMoment = moment(second)
16
  return secondMoment.isAfter(firstMoment)
17
}
18
19
export const parseError = (error) => {
20
  if (error.expected === 'object') {
21
    const e = error.message
22
    error.message = e.slice(0, e.indexOf('(object)')).trim()
23
  }
24
}
25